<template>
    <div>
        <my-toubu></my-toubu>
        <my-toutu></my-toutu>
        <div class="box" v-if="shuju">
            <div class="box1" ref="bgC">
                <div class="box1-tu">
                    <img :src="shuju.img" alt="">
                </div>
                <div class="wenBen-box">
                    <div class="timu">{{shuju.nm}}</div>
                    <div class="jies">{{shuju.enm}}</div>
                    <div class="fen">{{shuju.sc}} <span>{{shuju.dur}}分钟</span></div>
                    <div class="juQin">{{shuju.cat}}</div>
                    <div class="diFang">{{shuju.src}}<span></span></div>
                    <div class="time">{{shuju.pubDesc}}</div>
                </div>
            </div>
        </div>
        <my-liebiao></my-liebiao>
    </div>
</template>
<script>
import {mapState} from'vuex';
import myToubu from"../components/headRuten.vue";
import myToutu from"../components/myhead-tu.vue";
import myLiebiao from"../purchasePiao/gouPiaoliebiao";

export default {
    components:{
        myToubu,
        myToutu,
        myLiebiao

    },
    methods:{
     async qingqiu(){
        
        let Pm = await this.axios.get("https://apis.netstart.cn/maoyan/movie/intro?movieid="+this.$route.params.id)
        console.log(Pm.data.data.movie);
        this.shuju = Pm.data.data.movie
         this.$nextTick(() => {
        this.$refs.bgC.style.backgroundColor = this.shuju.backgroundColor;
      });

        

        },
        getNowFormatDate() {
        let date = new Date();
        let seperator1 = "-";
        let year = date.getFullYear();
        let month = date.getMonth() + 1;
        let strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }

        let currentdate = year + seperator1 + month + seperator1 + strDate;
        return currentdate;
        },
    
    
    //2019-6-28
    //2019-7-5

    },
    data(){
        return{
            idd:null,
            shuju:null,
            tiemArr:[],
        }
    },
    computed:{

    ...mapState(["crr","arr"])        
    },
    created(){
        this.qingqiu()
       
        // console.log( 
        //      this.getNowFormatDate()
        // );
      
     
    }
}
</script>
<style lang="less" scoped>
    .box{
        .box1{
            // background-color: #402629;
            width: 100%;
            box-sizing: border-box;
            display: flex;
            padding: 10px;
            .box1-tu{
                width: 110px;
                height: 150px;
                img{
                    width: 110px;
                height: 150px;
                }
            }
            .wenBen-box{
                width: 100%;
                box-sizing: border-box;
                color: #fff;
                padding-left: 15px;
                >div{
                    margin-bottom: 7px;
                }
                .timu{
                    font-size: 20px;
                    font-weight: 600;
                    white-space: nowrap;
                    text-overflow: ellipsis;
                    overflow: hidden;


                }
                .jies{
                    font-size: 10px;
                     white-space: nowrap;
                    text-overflow: ellipsis;
                    overflow: hidden;


                }
                .fen{
                    font-size: 18px;
                    font-weight: 700;
                    color: #fc0;
                    span{
                        font-size: 10px;
                        font-weight: 100;
                        color: #fff;
                        margin-left: 10px;
                    }
                    }

                
                .juQin{
                    font-size: 10px;

                }
                .diFang{
                    font-size: 10px;
                    

                }
                .time{
                    font-size: 10px;

                    
                }

            }
        }
    }
</style>